import Home from '../pages/Home/index'
import Article from '../pages/Artcle/index'
import Publish from '../pages/Publish/index'
import Login from '../pages/Login/index'
import Layout from '../pages/Layout/index'
import NotFound from '../pages/NotFound/index'
import AuthRoute from '../components/AuthRoute/index'
import { createBrowserRouter } from 'react-router-dom'

const routes = createBrowserRouter([
  {
    path: '/',
    element: <AuthRoute element={<Layout />} />,
    children: [
      { path: '/', element: <Home /> },
      { path: '/article', element: <Article /> },
      { path: '/publish/*', element: <Publish /> },
    ],
  },
  {
    path: '/login',
    element: <Login />,
  },
  {
    path: '*',
    element: <NotFound />,
  },
]);

export default routes;